//
//  ERClassAttributes.h
//  metadata
//
//  Created by easy on 11-5-30.
//  Copyright 2011 zeasy@qq.com. All rights reserved.
//

#import "ERuntime.h"
//	ERContext 下所有类特性，包括但不限于 Field,Method,Property,Class(Protocol and more)
@interface ERClassAttributes : NSObject {
	ERClass *clazz;
	
	NSMutableDictionary /*NSString*/*instanceFieldAliases;
	
	NSMutableDictionary /*ERString*/*instanceMethodAliases;
	
	NSMutableDictionary /*ERString*/*propertyAliases;
}
#pragma mark property
@property (nonatomic, readonly) ERClass *clazz;
@property (nonatomic, readwrite, assign) ERClass *superClazz;					//父类，set方法过期
@property (nonatomic, readonly) NSString *name;						//类名
@property (nonatomic, readonly) NSUInteger instanceSize;			//类实例所占空间大小
@property (nonatomic, readwrite, assign) int version;						//版本号
@property (nonatomic, readwrite, assign) NSString *iverLayout;
@property (nonatomic, readwrite, assign) NSString *weakIverLayout;
@property (nonatomic, readonly) NSMutableDictionary *instanceFieldAliases;	//field类型别名管理器
@property (nonatomic, readonly) NSMutableDictionary *instanceMethodAliases;	//method别名管理器
@property (nonatomic, readonly) NSMutableDictionary *propertyAliases;	//property别名管理器
#pragma mark init
-(id) initWithERClass:(ERClass *) eClass;

#pragma mark alias
//映射Field别名	注：不允许出现别名是已有的field名
-(void) mappingFieldAlias:(NSString *)alias withName:(NSString *) fieldName;
//映射Method别名	注：不允许出现别名是已有的field名
-(void) mappingMethodAlias:(NSString *)alias withName:(NSString *) methodName;
//映射Property别名	注：不允许出现别名是已有的field名
-(void) mappingPropertyAlias:(NSString *)alias withName:(NSString *) propertyName;

#pragma mark field
-(ERField *) instanceFieldWithName:(NSString *) fieldName;
-(ERField *) classFieldWithName:(NSString *) fieldName;
//-(void) reloadFields;
-(NSArray *) allFields;
-(NSArray *) allFieldNames;
#pragma mark method
-(ERMethod *) instanceMethodWithName:(NSString *) methodName;
-(ERMethod *) classMethodWithName:(NSString *) methodName; 
-(NSArray /*ERMethod*/*) allMethods;
-(NSArray /*NSString*/*) allMethodNames;
#pragma mark property
-(ERProperty *) propertyWithName:(NSString *) propertyName; 
-(NSArray /*ERProperty*/*) allProperties;
-(NSArray /*NSString*/*) allPropertyNames;
@end
